package com.ovopark.firecar.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.List;

/**
 * 创建人：yaoao
 * 创建日期：2021/5/29.10:51
 * 描述：字典
 * 修改人：
 * 迭代版本：
 * 迭代说明：
 */
public class DictBean implements Serializable, Parcelable {
    private Integer id;
    private String type;
    private String dname;
    private String description;
    private Integer sort;
    private Integer fatherid;
    private String value;
    private String systemid;
    private String systemName;
    private String code;
    private Integer creatorId;
    private String creatorName;
    private String createTime;
    private String reserve1;//话术具体内容
    private Integer dictState;
    private List<DictBean> children;

    public DictBean() {

    }

    protected DictBean(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readInt();
        }
        type = in.readString();
        dname = in.readString();
        description = in.readString();
        if (in.readByte() == 0) {
            sort = null;
        } else {
            sort = in.readInt();
        }
        if (in.readByte() == 0) {
            fatherid = null;
        } else {
            fatherid = in.readInt();
        }
        value = in.readString();
        systemid = in.readString();
        systemName = in.readString();
        code = in.readString();
        if (in.readByte() == 0) {
            creatorId = null;
        } else {
            creatorId = in.readInt();
        }
        creatorName = in.readString();
        createTime = in.readString();
        if (in.readByte() == 0) {
            dictState = null;
        } else {
            dictState = in.readInt();
        }
        reserve1 = in.readString();
    }

    public static final Creator<DictBean> CREATOR = new Creator<DictBean>() {
        @Override
        public DictBean createFromParcel(Parcel in) {
            return new DictBean(in);
        }

        @Override
        public DictBean[] newArray(int size) {
            return new DictBean[size];
        }
    };

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getFatherid() {
        return fatherid;
    }

    public void setFatherid(Integer fatherid) {
        this.fatherid = fatherid;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getSystemid() {
        return systemid;
    }

    public void setSystemid(String systemid) {
        this.systemid = systemid;
    }

    public String getSystemName() {
        return systemName;
    }

    public void setSystemName(String systemName) {
        this.systemName = systemName;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(Integer creatorId) {
        this.creatorId = creatorId;
    }

    public String getCreatorName() {
        return creatorName;
    }

    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Integer getDictState() {
        return dictState;
    }

    public void setDictState(Integer dictState) {
        this.dictState = dictState;
    }

    public List<DictBean> getChildren() {
        return children;
    }

    public void setChildren(List<DictBean> children) {
        this.children = children;
    }

    public String getReserve1() {
        return reserve1;
    }

    public void setReserve1(String reserve1) {
        this.reserve1 = reserve1;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        if (id == null) {
            parcel.writeByte((byte) 0);
        } else {
            parcel.writeByte((byte) 1);
            parcel.writeInt(id);
        }
        parcel.writeString(type);
        parcel.writeString(dname);
        parcel.writeString(description);
        if (sort == null) {
            parcel.writeByte((byte) 0);
        } else {
            parcel.writeByte((byte) 1);
            parcel.writeInt(sort);
        }
        if (fatherid == null) {
            parcel.writeByte((byte) 0);
        } else {
            parcel.writeByte((byte) 1);
            parcel.writeInt(fatherid);
        }
        parcel.writeString(value);
        parcel.writeString(systemid);
        parcel.writeString(systemName);
        parcel.writeString(code);
        if (creatorId == null) {
            parcel.writeByte((byte) 0);
        } else {
            parcel.writeByte((byte) 1);
            parcel.writeInt(creatorId);
        }
        parcel.writeString(creatorName);
        parcel.writeString(createTime);
        if (dictState == null) {
            parcel.writeByte((byte) 0);
        } else {
            parcel.writeByte((byte) 1);
            parcel.writeInt(dictState);
        }
        parcel.writeString(reserve1);
    }
}
